<!DOCTYPE html>
<html lang=zh>
<head>
  <meta charset="utf-8">
  
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-transform" />
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no,email=no,adress=no">
  <!-- Color theme for statusbar -->
  <meta name="theme-color" content="#000000" />
  <!-- 强制页面在当前窗口以独立页面显示,防止别人在框架里调用页面 -->
  <meta http-equiv="window-target" content="_top" />
  
  <meta name="google-site-verification" content="XKEVBvaS3n3qpVoP-hQqQ2XJ9t43pt4B7J1sLZgRJG4" />
  
  
  <title>技术分享 | 如何为你的代码选择一个合适的开源协议？ | DBKernel - 专注于分享数据库技术</title>
  <meta name="description" content="近期公司全面拥抱开源，在选择开源协议方面遇到了一些问题，查阅了很多资料，特此总结~~">
<meta property="og:type" content="article">
<meta property="og:title" content="技术分享 | 如何为你的代码选择一个合适的开源协议？">
<meta property="og:url" content="http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/index.html">
<meta property="og:site_name" content="DBKernel">
<meta property="og:description" content="近期公司全面拥抱开源，在选择开源协议方面遇到了一些问题，查阅了很多资料，特此总结~~">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/paul-bagwell-licence.jpeg">
<meta property="og:image" content="http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/ruan-yi-feng-licence.jpeg">
<meta property="og:image" content="https://dbkernel-1306518848.cos.ap-beijing.myqcloud.com/wechat/my-wechat-official-account.png">
<meta property="article:published_time" content="2021-08-18T16:37:15.000Z">
<meta property="article:modified_time" content="2021-09-24T04:07:20.435Z">
<meta property="article:author" content="DBKernel">
<meta property="article:tag" content="开源协议">
<meta property="article:tag" content="开源许可证">
<meta property="article:tag" content="LICENCE">
<meta property="article:tag" content="github">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/paul-bagwell-licence.jpeg">
  <!-- Canonical links -->
  <link rel="canonical" href="http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/index.html">
  
    <link rel="alternate" href="/atom.xml" title="DBKernel" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png" type="image/x-icon">
  
  
<link rel="stylesheet" href="../../../../css/style.css">

  
  
  
  
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1.4.0/dist/gitalk.min.css">
  
<meta name="generator" content="Hexo 5.4.0"></head>


<body class="main-center" itemscope itemtype="http://schema.org/WebPage">
  <header class="header" itemscope itemtype="http://schema.org/WPHeader">
  <div class="slimContent">
    <div class="navbar-header">
      
      
      <div class="profile-block text-center">
        <a id="avatar" href="https://github.com/dbkernel" target="_blank">
          <img class="img-circle img-rotate" src="../../../../images/avatar.png" width="200" height="200">
        </a>
        <h2 id="name" class="hidden-xs hidden-sm">DBKernel</h2>
        <h3 id="title" class="hidden-xs hidden-sm hidden-md">资深数据库开发工程师</h3>
        <small id="location" class="text-muted hidden-xs hidden-sm"><i class="icon icon-map-marker"></i> Beijing, China</small>
      </div>
      
      <div class="search" id="search-form-wrap">

    <form class="search-form sidebar-form">
        <div class="input-group">
            <input type="text" class="search-form-input form-control" placeholder="搜索" />
            <span class="input-group-btn">
                <button type="submit" class="search-form-submit btn btn-flat" onclick="return false;"><i class="icon icon-search"></i></button>
            </span>
        </div>
    </form>
    <div class="ins-search">
  <div class="ins-search-mask"></div>
  <div class="ins-search-container">
    <div class="ins-input-wrapper">
      <input type="text" class="ins-search-input" placeholder="想要查找什么..." x-webkit-speech />
      <button type="button" class="close ins-close ins-selectable" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    </div>
    <div class="ins-section-wrapper">
      <div class="ins-section-container"></div>
    </div>
  </div>
</div>


</div>
      <button class="navbar-toggle collapsed" type="button" data-toggle="collapse" data-target="#main-navbar" aria-controls="main-navbar" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>
    <nav id="main-navbar" class="collapse navbar-collapse" itemscope itemtype="http://schema.org/SiteNavigationElement" role="navigation">
      <ul class="nav navbar-nav main-nav ">
        
        
        <li class="menu-item menu-item-home">
          <a href="../../../../.">
            
            <i class="icon icon-home-fill"></i>
            
            <span class="menu-title">首页</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-archives">
          <a href="../../../../archives">
            
            <i class="icon icon-archives-fill"></i>
            
            <span class="menu-title">归档</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-categories">
          <a href="../../../../categories">
            
            <i class="icon icon-folder"></i>
            
            <span class="menu-title">分类</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-tags">
          <a href="../../../../tags">
            
            <i class="icon icon-tags"></i>
            
            <span class="menu-title">标签</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-repository">
          <a href="../../../../repository">
            
            <i class="icon icon-project"></i>
            
            <span class="menu-title">项目</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-links">
          <a href="../../../../links">
            
            <i class="icon icon-friendship"></i>
            
            <span class="menu-title">友链</span>
          </a>
        </li>
        
        
        <li class="menu-item menu-item-about">
          <a href="../../../../about">
            
            <i class="icon icon-cup-fill"></i>
            
            <span class="menu-title">关于</span>
          </a>
        </li>
        
      </ul>
      
	
    <ul class="social-links">
    	
        <li><a href="../../../../https:/github.com/dbkernel" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="../../../../atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    </nav>
  </div>
</header>

  
    <aside class="sidebar" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    
      <div class="widget">
    <h3 class="widget-title">公告</h3>
    <div class="widget-body">
        <div id="board">
            <div class="content">
                <p>本站专注于分享关系型数据库及分布式数据库相关技术！如需深入交流，可添加我的微信或关注我的公众号数据库内核：</br><img src="/images/wechat-me.jpeg" width="130" height="130"/> <img src="/images/wechat-gzh.jpeg" width="130" height="130"/></p>
            </div>
        </div>
    </div>
</div>

    
      
  <div class="widget">
    <h3 class="widget-title">分类</h3>
    <div class="widget-body">
      <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="../../../../categories/ClickHouse/">ClickHouse</a><span class="category-list-count">14</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/C%E8%AF%AD%E8%A8%80/">C语言</a><span class="category-list-count">8</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/GreenPlum/">GreenPlum</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/Linux/">Linux</a><span class="category-list-count">5</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/MySQL/">MySQL</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/PostgreSQL/">PostgreSQL</a><span class="category-list-count">7</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/Postgres-X2/">Postgres-X2</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/%E7%BC%96%E8%AF%91%E8%B0%83%E8%AF%95/">编译调试</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="../../../../categories/%E9%80%9A%E7%94%A8/">通用</a><span class="category-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签</h3>
    <div class="widget-body">
      <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/APUE/" rel="tag">APUE</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/B-Tree/" rel="tag">B-Tree</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ClickHouse/" rel="tag">ClickHouse</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ClickHouse%E5%92%8C%E4%BB%96%E7%9A%84%E6%9C%8B%E5%8F%8B%E4%BB%AC/" rel="tag">ClickHouse和他的朋友们</a><span class="tag-list-count">14</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Count/" rel="tag">Count</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/C%E8%AF%AD%E8%A8%80/" rel="tag">C语言</a><span class="tag-list-count">10</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/DAG-Scheduler/" rel="tag">DAG Scheduler</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/GreenPlum/" rel="tag">GreenPlum</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/HEAP%E5%BC%95%E6%93%8E/" rel="tag">HEAP引擎</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/LICENCE/" rel="tag">LICENCE</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/LSM-Tree/" rel="tag">LSM-Tree</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Linux/" rel="tag">Linux</a><span class="tag-list-count">7</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MEMORY%E5%BC%95%E6%93%8E/" rel="tag">MEMORY引擎</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Makefile/" rel="tag">Makefile</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Materialized-View/" rel="tag">Materialized View</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MergeTree/" rel="tag">MergeTree</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/MySQL/" rel="tag">MySQL</a><span class="tag-list-count">8</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Parser/" rel="tag">Parser</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Percona/" rel="tag">Percona</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/PostgreSQL/" rel="tag">PostgreSQL</a><span class="tag-list-count">11</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Postgres-X2/" rel="tag">Postgres-X2</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Postgres-XC/" rel="tag">Postgres-XC</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/RadonDB/" rel="tag">RadonDB</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/ReplicatedMergeTree/" rel="tag">ReplicatedMergeTree</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Select/" rel="tag">Select</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/UNIX/" rel="tag">UNIX</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/WAL/" rel="tag">WAL</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Xenon/" rel="tag">Xenon</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/Xtrabackup/" rel="tag">Xtrabackup</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/auto-increment/" rel="tag">auto_increment</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/crontab/" rel="tag">crontab</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/daemon/" rel="tag">daemon</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/df/" rel="tag">df</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/du/" rel="tag">du</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/gcc/" rel="tag">gcc</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/gcov/" rel="tag">gcov</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/getopt/" rel="tag">getopt</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/github/" rel="tag">github</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/group-by/" rel="tag">group by</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/lcov/" rel="tag">lcov</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/libpq/" rel="tag">libpq</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pg-constraint/" rel="tag">pg_constraint</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pg-depend/" rel="tag">pg_depend</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pgbench/" rel="tag">pgbench</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/pipeline/" rel="tag">pipeline</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/processor/" rel="tag">processor</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/shell/" rel="tag">shell</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E4%B8%BB%E4%BB%8E%E5%90%8C%E6%AD%A5/" rel="tag">主从同步</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E4%BC%98%E5%8C%96%E5%99%A8/" rel="tag">优化器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%86%85%E5%AD%98%E5%88%86%E9%85%8D/" rel="tag">内存分配</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86/" rel="tag">内存管理</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%9B%9E%E5%BD%92%E6%B5%8B%E8%AF%95/" rel="tag">回归测试</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AD%97%E8%8A%82%E5%AF%B9%E9%BD%90/" rel="tag">字节对齐</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AD%97%E8%8A%82%E5%BA%8F/" rel="tag">字节序</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%AD%98%E5%82%A8%E8%AE%A1%E7%AE%97%E5%88%86%E7%A6%BB/" rel="tag">存储计算分离</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%B9%B6%E8%A1%8C%E6%9F%A5%E8%AF%A2/" rel="tag">并行查询</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE/" rel="tag">开源协议</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E8%AF%81/" rel="tag">开源许可证</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%9C%AC%E5%9C%B0%E4%BA%8B%E5%8A%A1/" rel="tag">本地事务</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%B5%8B%E8%AF%95/" rel="tag">测试</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/" rel="tag">源码分析</a><span class="tag-list-count">15</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/" rel="tag">系统运维</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BC%96%E8%AF%91%E5%99%A8/" rel="tag">编译器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BD%91%E7%BB%9C%E5%BA%8F/" rel="tag">网络序</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" rel="tag">网络编程</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="../../../../tags/%E9%97%AE%E9%A2%98%E5%AE%9A%E4%BD%8D/" rel="tag">问题定位</a><span class="tag-list-count">2</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">标签云</h3>
    <div class="widget-body tagcloud">
      <a href="../../../../tags/APUE/" style="font-size: 13.33px;">APUE</a> <a href="../../../../tags/B-Tree/" style="font-size: 13px;">B-Tree</a> <a href="../../../../tags/ClickHouse/" style="font-size: 13.89px;">ClickHouse</a> <a href="../../../../tags/ClickHouse%E5%92%8C%E4%BB%96%E7%9A%84%E6%9C%8B%E5%8F%8B%E4%BB%AC/" style="font-size: 13.89px;">ClickHouse和他的朋友们</a> <a href="../../../../tags/Count/" style="font-size: 13px;">Count</a> <a href="../../../../tags/C%E8%AF%AD%E8%A8%80/" style="font-size: 13.67px;">C语言</a> <a href="../../../../tags/DAG-Scheduler/" style="font-size: 13px;">DAG Scheduler</a> <a href="../../../../tags/GreenPlum/" style="font-size: 13.22px;">GreenPlum</a> <a href="../../../../tags/HEAP%E5%BC%95%E6%93%8E/" style="font-size: 13px;">HEAP引擎</a> <a href="../../../../tags/LICENCE/" style="font-size: 13px;">LICENCE</a> <a href="../../../../tags/LSM-Tree/" style="font-size: 13px;">LSM-Tree</a> <a href="../../../../tags/Linux/" style="font-size: 13.44px;">Linux</a> <a href="../../../../tags/MEMORY%E5%BC%95%E6%93%8E/" style="font-size: 13px;">MEMORY引擎</a> <a href="../../../../tags/Makefile/" style="font-size: 13px;">Makefile</a> <a href="../../../../tags/Materialized-View/" style="font-size: 13px;">Materialized View</a> <a href="../../../../tags/MergeTree/" style="font-size: 13.11px;">MergeTree</a> <a href="../../../../tags/MySQL/" style="font-size: 13.56px;">MySQL</a> <a href="../../../../tags/Parser/" style="font-size: 13px;">Parser</a> <a href="../../../../tags/Percona/" style="font-size: 13px;">Percona</a> <a href="../../../../tags/PostgreSQL/" style="font-size: 13.78px;">PostgreSQL</a> <a href="../../../../tags/Postgres-X2/" style="font-size: 13px;">Postgres-X2</a> <a href="../../../../tags/Postgres-XC/" style="font-size: 13px;">Postgres-XC</a> <a href="../../../../tags/RadonDB/" style="font-size: 13px;">RadonDB</a> <a href="../../../../tags/ReplicatedMergeTree/" style="font-size: 13px;">ReplicatedMergeTree</a> <a href="../../../../tags/Select/" style="font-size: 13px;">Select</a> <a href="../../../../tags/UNIX/" style="font-size: 13.22px;">UNIX</a> <a href="../../../../tags/WAL/" style="font-size: 13.11px;">WAL</a> <a href="../../../../tags/Xenon/" style="font-size: 13px;">Xenon</a> <a href="../../../../tags/Xtrabackup/" style="font-size: 13px;">Xtrabackup</a> <a href="../../../../tags/auto-increment/" style="font-size: 13px;">auto_increment</a> <a href="../../../../tags/crontab/" style="font-size: 13px;">crontab</a> <a href="../../../../tags/daemon/" style="font-size: 13px;">daemon</a> <a href="../../../../tags/df/" style="font-size: 13px;">df</a> <a href="../../../../tags/du/" style="font-size: 13px;">du</a> <a href="../../../../tags/gcc/" style="font-size: 13px;">gcc</a> <a href="../../../../tags/gcov/" style="font-size: 13px;">gcov</a> <a href="../../../../tags/getopt/" style="font-size: 13px;">getopt</a> <a href="../../../../tags/github/" style="font-size: 13px;">github</a> <a href="../../../../tags/group-by/" style="font-size: 13px;">group by</a> <a href="../../../../tags/lcov/" style="font-size: 13px;">lcov</a> <a href="../../../../tags/libpq/" style="font-size: 13px;">libpq</a> <a href="../../../../tags/pg-constraint/" style="font-size: 13px;">pg_constraint</a> <a href="../../../../tags/pg-depend/" style="font-size: 13px;">pg_depend</a> <a href="../../../../tags/pgbench/" style="font-size: 13px;">pgbench</a> <a href="../../../../tags/pipeline/" style="font-size: 13px;">pipeline</a> <a href="../../../../tags/processor/" style="font-size: 13px;">processor</a> <a href="../../../../tags/shell/" style="font-size: 13px;">shell</a> <a href="../../../../tags/%E4%B8%BB%E4%BB%8E%E5%90%8C%E6%AD%A5/" style="font-size: 13.11px;">主从同步</a> <a href="../../../../tags/%E4%BC%98%E5%8C%96%E5%99%A8/" style="font-size: 13px;">优化器</a> <a href="../../../../tags/%E5%86%85%E5%AD%98%E5%88%86%E9%85%8D/" style="font-size: 13px;">内存分配</a> <a href="../../../../tags/%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86/" style="font-size: 13px;">内存管理</a> <a href="../../../../tags/%E5%9B%9E%E5%BD%92%E6%B5%8B%E8%AF%95/" style="font-size: 13px;">回归测试</a> <a href="../../../../tags/%E5%AD%97%E8%8A%82%E5%AF%B9%E9%BD%90/" style="font-size: 13.11px;">字节对齐</a> <a href="../../../../tags/%E5%AD%97%E8%8A%82%E5%BA%8F/" style="font-size: 13.11px;">字节序</a> <a href="../../../../tags/%E5%AD%98%E5%82%A8%E8%AE%A1%E7%AE%97%E5%88%86%E7%A6%BB/" style="font-size: 13px;">存储计算分离</a> <a href="../../../../tags/%E5%B9%B6%E8%A1%8C%E6%9F%A5%E8%AF%A2/" style="font-size: 13px;">并行查询</a> <a href="../../../../tags/%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE/" style="font-size: 13px;">开源协议</a> <a href="../../../../tags/%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E8%AF%81/" style="font-size: 13px;">开源许可证</a> <a href="../../../../tags/%E6%9C%AC%E5%9C%B0%E4%BA%8B%E5%8A%A1/" style="font-size: 13px;">本地事务</a> <a href="../../../../tags/%E6%B5%8B%E8%AF%95/" style="font-size: 13px;">测试</a> <a href="../../../../tags/%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/" style="font-size: 14px;">源码分析</a> <a href="../../../../tags/%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/" style="font-size: 13px;">系统运维</a> <a href="../../../../tags/%E7%BC%96%E8%AF%91%E5%99%A8/" style="font-size: 13px;">编译器</a> <a href="../../../../tags/%E7%BD%91%E7%BB%9C%E5%BA%8F/" style="font-size: 13.11px;">网络序</a> <a href="../../../../tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" style="font-size: 13px;">网络编程</a> <a href="../../../../tags/%E9%97%AE%E9%A2%98%E5%AE%9A%E4%BD%8D/" style="font-size: 13.11px;">问题定位</a>
    </div>
  </div>

    
      
  <div class="widget">
    <h3 class="widget-title">归档</h3>
    <div class="widget-body">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/08/">八月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2021/01/">一月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/09/">九月 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/08/">八月 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/07/">七月 2020</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/06/">六月 2020</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2020/05/">五月 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2019/12/">十二月 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2019/04/">四月 2019</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2018/09/">九月 2018</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/11/">十一月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/04/">四月 2016</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/03/">三月 2016</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2016/01/">一月 2016</a><span class="archive-list-count">2</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/12/">十二月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/11/">十一月 2015</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/05/">五月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2015/01/">一月 2015</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/08/">八月 2014</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/07/">七月 2014</a><span class="archive-list-count">5</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/03/">三月 2014</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="../../../../archives/2014/01/">一月 2014</a><span class="archive-list-count">1</span></li></ul>
    </div>
  </div>


    
      
  <div class="widget">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget-body">
      <ul class="recent-post-list list-unstyled no-thumbnail">
        
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/%E9%80%9A%E7%94%A8/">通用</a>
              </p>
              <p class="item-title">
                <a href="" class="title">技术分享 | 如何为你的代码选择一个合适的开源协议？</a>
              </p>
              <p class="item-date">
                <time datetime="2021-08-18T16:37:15.000Z" itemprop="datePublished">2021-08-19</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../01/26/clickhouse-and-friends-15-groupby/" class="title">源码分析 | ClickHouse和他的朋友们（15）Group By 为什么这么快</a>
              </p>
              <p class="item-date">
                <time datetime="2021-01-26T13:31:12.000Z" itemprop="datePublished">2021-01-26</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../../2020/09/21/clickhouse-and-friends-14-compute-storage/" class="title">源码分析 | ClickHouse和他的朋友们（14）存储计算分离方案与实现</a>
              </p>
              <p class="item-date">
                <time datetime="2020-09-21T14:01:12.000Z" itemprop="datePublished">2020-09-21</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../../2020/09/15/clickhouse-and-friends-13-replicated-merge-tree/" class="title">源码分析 | ClickHouse和他的朋友们（13）ReplicatedMergeTree表引擎及同步机制</a>
              </p>
              <p class="item-date">
                <time datetime="2020-09-15T12:15:14.000Z" itemprop="datePublished">2020-09-15</time>
              </p>
            </div>
          </li>
          
          <li>
            
            <div class="item-inner">
              <p class="item-category">
                <a class="category-link" href="../../../../categories/ClickHouse/">ClickHouse</a>
              </p>
              <p class="item-title">
                <a href="../../../../2020/09/03/clickhouse-and-friends-12-materialized-view/" class="title">源码分析 | ClickHouse和他的朋友们（12）神奇的物化视图(Materialized View)与原理</a>
              </p>
              <p class="item-date">
                <time datetime="2020-09-03T13:22:14.000Z" itemprop="datePublished">2020-09-03</time>
              </p>
            </div>
          </li>
          
      </ul>
    </div>
  </div>
  

    
  </div>
</aside>

  
  
<aside class="sidebar sidebar-toc collapse" id="collapseToc" itemscope itemtype="http://schema.org/WPSideBar">
  <div class="slimContent">
    <nav id="toc" class="article-toc">
      <h3 class="toc-title">文章目录</h3>
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E8%A8%80"><span class="toc-number">1.</span> <span class="toc-text">前言</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%BF%AB%E9%80%9F%E9%80%89%E6%8B%A9%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE"><span class="toc-number">2.</span> <span class="toc-text">快速选择开源协议</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%B8%BB%E6%B5%81%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE%EF%BC%88Open-Source-License%EF%BC%89"><span class="toc-number">3.</span> <span class="toc-text">主流开源许可协议（Open Source License）</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#MIT"><span class="toc-number">3.1.</span> <span class="toc-text">MIT</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#BSD"><span class="toc-number">3.2.</span> <span class="toc-text">BSD</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Apache-Licence"><span class="toc-number">3.3.</span> <span class="toc-text">Apache Licence</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#LGPL"><span class="toc-number">3.4.</span> <span class="toc-text">LGPL</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#GPL"><span class="toc-number">3.5.</span> <span class="toc-text">GPL</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9B%B4%E5%A4%9A%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE%E5%AF%B9%E6%AF%94"><span class="toc-number">4.</span> <span class="toc-text">更多开源协议对比</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E9%93%BE%E6%8E%A5"><span class="toc-number">5.</span> <span class="toc-text">参考链接</span></a></li></ol>
    </nav>
  </div>
</aside>

<main class="main" role="main">
  <div class="content">
  <article id="post-how-to-choose-open-source-licence" class="article article-type-post" itemscope itemtype="http://schema.org/BlogPosting">
    
    <div class="article-header">
      
        
  
    <h1 class="article-title" itemprop="name">
      技术分享 | 如何为你的代码选择一个合适的开源协议？
    </h1>
  

      
      <div class="article-meta">
        <span class="article-date">
    <i class="icon icon-calendar-check"></i>
	<a href="" class="article-date">
	  <time datetime="2021-08-18T16:37:15.000Z" itemprop="datePublished">2021-08-19</time>
	</a>
</span>
        
  <span class="article-category">
    <i class="icon icon-folder"></i>
    <a class="article-category-link" href="../../../../categories/%E9%80%9A%E7%94%A8/">通用</a>
  </span>

        
  <span class="article-tag">
    <i class="icon icon-tags"></i>
	<a class="article-tag-link-link" href="../../../../tags/LICENCE/" rel="tag">LICENCE</a>, <a class="article-tag-link-link" href="../../../../tags/github/" rel="tag">github</a>, <a class="article-tag-link-link" href="../../../../tags/%E5%BC%80%E6%BA%90%E5%8D%8F%E8%AE%AE/" rel="tag">开源协议</a>, <a class="article-tag-link-link" href="../../../../tags/%E5%BC%80%E6%BA%90%E8%AE%B8%E5%8F%AF%E8%AF%81/" rel="tag">开源许可证</a>
  </span>


        
	<span class="article-read hidden-xs">
	    <i class="icon icon-eye-fill" aria-hidden="true"></i>
	    <span id="busuanzi_container_page_pv">
			<span id="busuanzi_value_page_pv">0</span>
		</span>
	</span>


        <span class="post-comment"><i class="icon icon-comment"></i> <a href="#comments" class="article-comment-link">评论</a></span>
        
	
		<span class="post-wordcount hidden-xs" itemprop="wordCount">字数统计: 3.6k(字)</span>
	
	
		<span class="post-readcount hidden-xs" itemprop="timeRequired">阅读时长: 12(分)</span>
	

      </div>
    </div>
    <div class="article-entry marked-body" itemprop="articleBody">
      
        <p>近期公司全面拥抱开源，在选择开源协议方面遇到了一些问题，查阅了很多资料，特此总结~~</p>
<span id="more"></span>

<blockquote>
<p><strong>本文首发于 2021-08-19 00:37:15</strong></p>
</blockquote>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>对于很多刚踏入开源软件这个行业的小伙伴来说，在编码过程中难免会用到其他人的成果，如果你足够细心，很容易注意到即使是一小段代码，优秀的作者都在文件开头附上一段关于版权的声明，比如 <code>Licensed under the MIT license</code>。同时，一些博客也会标明”此文章采用 <code>CC BY 4.0 CN</code> 协议“。</p>
<p>如果我们拷贝了别人的代码或文章却没注意版权问题，在国外法律意识特别强的环境下（国内版权意识也在逐步加强），那么我们的作品会因触犯别人的权益而违法。即使是最开放的开源协议，最低要求也是保留原作者对代码的声明，所以<code>开源不等于免费，也不等于没有约束</code>。</p>
<p><strong>何为 LICENCE？</strong></p>
<blockquote>
<p>LICENCE 是软件的授权许可，详细说明了获得代码后拥有的权利，哪些操作是允许的，哪些操作是禁止的。软件的版权许可证可有很多方式，本文仅限于讨论开源软件协议 Open Source License。</p>
</blockquote>
<p>对于大多数人来说，没必要花大把时间去写许可协议，选择一种比较流行的开源协议就足够了，省时省力，更便于自己作品的传播，于人于己都有利。</p>
<p><strong>PS：</strong></p>
<blockquote>
<p>说句题外话，很多国外开发者在尊重他人劳动成果方面做得很好，如果A的作品是因为B的作品的启发而来，A甚至都没有使用B任何一句代码，但A会在他的作品里面指明是受到了B的启发：<code>Inspired by XXX link: http://www.xxxx.com</code>。</p>
</blockquote>
<h2 id="快速选择开源协议"><a href="#快速选择开源协议" class="headerlink" title="快速选择开源协议"></a>快速选择开源协议</h2><p>如果你不想了解太多，只是想要一个简直直接的答案，下面给出的建议或许适合你。本小节关于协议地址来自于 GitHub <a target="_blank" rel="noopener" href="http://choosealicense.com/">choosealicence</a> 。</p>
<p><strong>简单宽松的协议：</strong></p>
<blockquote>
<p>如果你只想要一个简单点的协议不想太麻烦的话。</p>
<p><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/mit">MIT协议</a>相对宽松，此协议允许别人以任何方式使用你的代码同时署名原作者，但原作者不承担代码使用后的风险，当然也没有技术支持的义务。</p>
</blockquote>
<p><strong>考虑有专利的情况：</strong></p>
<blockquote>
<p>如果你的作品中涉及到专利相关。</p>
<p><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/apache/">Apache协议</a>也是个相对宽松的协议，与MIT类似，但它指明了作者对用户专利上的一些授权（我的理解是软件作品中含有专利，但它授权你可以免费使用）。</p>
</blockquote>
<p><strong>促进代码分享：</strong></p>
<blockquote>
<p>如果你在乎作品的传播和别人的修改，希望别人也以相同的协议分享出来。</p>
<p>GPL（<a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/gpl-v2">V2</a>或<a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/gpl-v3">V3</a>）协议要求代码分发者或者以此代码为基础开发出来的衍生作品需要以同样的协议来发布，也必须开源，因此，该协议具有”传染性“。</p>
</blockquote>
<p>乌克兰程序员<a target="_blank" rel="noopener" href="http://pbagwl.com/post/5078147450/description-of-popular-software-licenses">Paul Bagwell</a>，画了一张分析图，说明应该怎么选择。只用两分钟，你就能搞清楚这六种开源协议之间的最大区别。<br><img src="paul-bagwell-licence.jpeg" alt="Paul Bagwell的LICENCE分析图"></p>
<p>国内大神阮一峰的汉化版本：<br><img src="ruan-yi-feng-licence.jpeg" alt="阮一峰的LICENCE分析图"></p>
<h2 id="主流开源许可协议（Open-Source-License）"><a href="#主流开源许可协议（Open-Source-License）" class="headerlink" title="主流开源许可协议（Open Source License）"></a>主流开源许可协议（Open Source License）</h2><p>世界上的开源许可协议（Open Source License）大概有<a target="_blank" rel="noopener" href="https://www.gnu.org/licenses/license-list.html">上百种</a>，常用的开源软件协议大致有：</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://www.gnu.org/licenses/gpl-3.0.html">GPL</a></li>
<li><a target="_blank" rel="noopener" href="https://www.gnu.org/licenses/lgpl-3.0.html">LGPL</a></li>
<li><a target="_blank" rel="noopener" href="https://opensource.org/licenses/BSD-3-Clause">BSD</a></li>
<li><a target="_blank" rel="noopener" href="https://opensource.org/licenses/mit-license.php">MIT</a></li>
<li><a target="_blank" rel="noopener" href="https://opensource.org/licenses/MPL-2.0">Mozilla</a></li>
<li><a target="_blank" rel="noopener" href="http://www.apache.org/licenses/LICENSE-2.0">Apache</a></li>
</ul>
<p>由宽松到严紧排序，常用的开源协议有：</p>
<ol>
<li>MIT</li>
<li>BSD</li>
<li>Apache</li>
<li>LGPL</li>
<li>GPL</li>
</ol>
<p>主要区别：</p>
<ul>
<li>MIT、BSD 开源协议都源自大学，体现了简单、开放和包容的特点。</li>
<li>MIT、BSD、Apache 三者都支持闭源的后续开发。</li>
<li>GPL、LGPL 传染性开源，编译的代码里用了这里的代码，都必须开源。</li>
</ul>
<h3 id="MIT"><a href="#MIT" class="headerlink" title="MIT"></a>MIT</h3><p>来源于大学，MIT 开源协议是史上最为简洁、慷慨的开源协议之一。作者只想保留版权，而无任何其他了限制。也就是说，你必须在你的发行版里包含原许可协议的声明，无论你是以二进制发布的还是以源代码发布的。</p>
<p><strong>特点：</strong></p>
<ul>
<li>用户可以拿你的代码做任何想做的事情。</li>
<li>用户在项目副本中要包含版权声明和许可声明。</li>
<li>你无需承担任何责任。</li>
</ul>
<p><strong>代表作品：</strong></p>
<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/jquery/jquery">jQuery</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/rails/rails">Rails</a> 等。</li>
</ul>
<h3 id="BSD"><a href="#BSD" class="headerlink" title="BSD"></a>BSD</h3><ul>
<li><a target="_blank" rel="noopener" href="https://opensource.org/licenses/BSD-2-Clause">BSD-2-Clause</a></li>
<li><a target="_blank" rel="noopener" href="https://opensource.org/licenses/BSD-3-Clause">BSD-3-Clause</a></li>
</ul>
<p>BSD可证也来源于大学，与MIT差不多，也非常简单、慷慨。</p>
<p>BSD开源协议是一个给于使用者很大自由的协议。基本上使用者可以”为所欲为”,可以自由的使用、修改源代码，也可以将修改后的代码作为开源或者专有软件再发布。前提是当你发布使用了BSD协议的代码，或者以BSD协议代码为基础开发自己的产品时，需要满足三个条件：</p>
<ol>
<li>如果再发布的产品中包含源代码，则在源代码中必须带有原代码中的BSD协议。</li>
<li>如果再发布的只是二进制类库/软件，则需要在类库/软件的文档和版权声明中包含原来代码中的BSD协议。</li>
<li>不可以用开源代码的作者/机构名字和原来产品的名字做市场推广。</li>
</ol>
<p>BSD 开源协议鼓励代码共享，但需要尊重代码作者的著作权。BSD 开源协议允许使用者修改和重新发布代码，也允许使用或在BSD代码上开发商业软件发布、销售，是对商业集成很友好的协议。因此，很多公司在选用开源产品的时候都首选BSD协议。</p>
<h3 id="Apache-Licence"><a href="#Apache-Licence" class="headerlink" title="Apache Licence"></a>Apache Licence</h3><ul>
<li><a target="_blank" rel="noopener" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a></li>
<li><a target="_blank" rel="noopener" href="https://www.apache.org/licenses/LICENSE-1.1">Apache License, Version 1.1</a></li>
<li><a target="_blank" rel="noopener" href="https://www.apache.org/licenses/LICENSE-1.0">Apache License, Version 1.0</a></li>
</ul>
<p>来自 Apache，类似 MIT 开源协议，但它重视专利权。</p>
<p>Apache Licence 是著名的非盈利开源组织 Apache 采用的协议。该协议和BSD类似，同样鼓励代码共享和尊重原作者的著作权，同样允许修改代码、再发布（作为开源或商业软件）。需要满足的条件也和BSD类似：</p>
<ol>
<li>需要为使用代码的用户提供一份 Apache Licence 。</li>
<li>如果你修改了代码，需要在被修改的文件中说明。</li>
<li>在延伸的代码中（修改和由源代码衍生的代码中）需要带有原来代码中的协议、商标、专利声明和其他原作者规定需要包含的说明。</li>
<li>如果再发布的产品中包含一个<code>Notice</code>文件，则在Notice文件中需要带有 Apache Licence 。你可以在<code>Notice</code>中增加自己的许可，但不可对 Apache Licence 构成更改。</li>
</ol>
<p>Apache Licence 也是对商业应用友好的许可，使用者也可以在需要的时候修改代码来满足需要并作为开源或商业产品发布/销售。</p>
<p><strong>代表作品：</strong></p>
<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/apache/echarts">echarts</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/apache/superset">superset</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/apache/dubbo">dubbo</a></li>
<li><a target="_blank" rel="noopener" href="https://github.com/apache/spark">spark</a></li>
</ul>
<h3 id="LGPL"><a href="#LGPL" class="headerlink" title="LGPL"></a>LGPL</h3><p>LGPL（GNU LESSER GENERAL PUBLIC LICENSE）来自于自由软件联盟GNU，可以翻译为更宽松的GPL协议，也属于传染性开源协议。</p>
<p>LGPL是GPL的一个主要为类库使用设计的开源协议。和<code>GPL要求任何使用/修改/衍生之GPL类库的的软件必须采用GPL协议</code>不同，LGPL 允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码。这使得采用LGPL协议的开源代码可以被商业软件作为类库引用并发布和销售。</p>
<p>但是如果修改LGPL协议的代码或者衍生，则所有修改的代码，涉及修改部分的额外代码和衍生的代码都必须采用LGPL协议，因此，LGPL协议的开源代码很适合作为第三方类库被商业软件引用，但不适合希望以LGPL协议代码为基础，通过修改和衍生的方式做二次开发的商业软件采用。</p>
<p>GPL/LGPL都保障原作者的知识产权，避免有人利用开源代码复制并开发类似的产品。</p>
<h3 id="GPL"><a href="#GPL" class="headerlink" title="GPL"></a>GPL</h3><p>GPL（GNU GENERAL PUBLIC LICENSE）来源于自由软件联盟GNU，GPL/LGPL侧重于代码及衍生代码的开源与免费使用。</p>
<p>GPL协议的主要内容是只要在一个软件中使用（”使用”指类库引用，修改后的代码或者衍生代码）GPL 协议的产品，则该软件产品必须也采用GPL协议，既必须也是开源和免费。<strong>这就是所谓的”传染性”</strong>。</p>
<p>由于GPL严格要求使用了GPL类库的软件产品必须使用GPL协议，对于使用GPL协议的开源代码，商业软件或者对代码有保密要求的部门就不适合集成/采用作为类库和二次开发的基础。</p>
<p>我们很熟悉的Linux就是采用了GPL。GPL协议和BSD, Apache Licence等鼓励代码重用的许可很不一样。GPL的出发点是<code>代码的开源/免费使用/引用/修改</code>和<code>衍生代码的开源/免费使用</code>，但<code>不允许</code>修改后和衍生的代码做为<code>闭源</code>的商业软件发布和销售。</p>
<p>其它细节和BSD/Apache等协议类似。</p>
<p><strong>代表作品：</strong></p>
<ul>
<li><a target="_blank" rel="noopener" href="https://github.com/torvalds/linux">Linux</a></li>
</ul>
<h2 id="更多开源协议对比"><a href="#更多开源协议对比" class="headerlink" title="更多开源协议对比"></a>更多开源协议对比</h2><p>下方表格中出现的用词的解释：</p>
<ul>
<li><strong>协议和版权信息</strong>(License and copyright notice)：在代码中保留作者提供的协议和版权信息。</li>
<li><strong>声明变更</strong>(State Changes)：在代码中声明对原来代码的重大修改及变更。</li>
<li><strong>公开源码</strong>(Disclose Source)：代码必需公开。</li>
<li><strong>库引用</strong>(Library usage)：该库可以用于商业软件中。</li>
<li><strong>责任承担</strong>(Hold Liable)：代码的作者承担代码使用后的风险及产生的后果。如果禁止，那么作者将不会承担责任，可以理解为免责条款。</li>
<li><strong>商标使用</strong>(Use Trademark)：可以使用作者的姓名，作品的Logo，或商标。</li>
<li><strong>附加协议</strong>(Sublicensing)：允许在软件分发传播过程中附加上原来没有的协议条款等。</li>
</ul>
<table>
<thead>
<tr>
<th>协议</th>
<th>描述</th>
<th>要求</th>
<th>允许</th>
<th>禁止</th>
</tr>
</thead>
<tbody><tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/apache/">Apache</a></td>
<td>一个比较宽松且简明地指出了专利授权的协议。</td>
<td>1. <font color=#0000FF>协议和版权信息</font><br/>2. <font color=#0000FF>声明变更</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>专利授权</font><br/>5. <font color=#00EE00>私用</font><br/>6. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font>（作者免责）<br/>2. <font color=#FF3030>商标使用</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/gpl-v2/">GPL</a></td>
<td>应用最广泛的开源协议，拥有较强的版权自由（copyleft）要求。<br/>衍生代码的分发需开源并且也要遵守此协议。<br/>此协议有许多变种，不同变种的要求略有不同。</td>
<td>1. <font color=#0000FF>公开源码</font><br/>2. <font color=#0000FF>协议和版权信息</font><br/>3. <font color=#0000FF>声明变更</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>专利授权</font><br/>5. <font color=#00EE00>私用</font></td>
<td>1. <font color=#FF3030>责任承担</font><br/>2. <font color=#FF3030>附加协议</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/mit/">MIT</a></td>
<td>此协议宽松简单。在适当标明来源及免责的情况下，<br/>它允许你对代码进行任何形式的使用。</td>
<td>1. <font color=#0000FF>协议和版权信息</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>私用</font><br/>5. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/artistic/">Artistic</a></td>
<td>Perl社区最钟爱此协议。<br/>要求更改后的软件不能影响原软件的使用。</td>
<td>1. <font color=#0000FF>协议和版权信息</font><br/>2. <font color=#0000FF>声明变更</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>私用</font><br/>5. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font><br/>2. <font color=#FF3030>商标使用</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/bsd/">BSD</a></td>
<td>较为宽松的协议，有两个变种<a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/bsd"><strong>BSD 2-Clause</strong></a> 和<a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/bsd-3-clause"><strong>BSD 3-Clause</strong></a>，<br/>两者都与MIT协议只存在细微差异。</td>
<td>1. <font color=#0000FF>协议和版权信息</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>私用</font><br/>5. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/eclipse/">Eclipse</a></td>
<td>对商用非常友好的协议，可以用于软件的商业授权。<br/>包含对专利的优雅授权，也可以对相关代码应用商业协议。</td>
<td>1. <font color=#0000FF>公开源码</font><br/>2. <font color=#0000FF>协议和版权信息</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>专利授权</font><br/>5. <font color=#00EE00>私用</font><br/>6. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/lgpl-v2.1/">LGPL</a></td>
<td>主要用于一些代码库。<br/>衍生代码可以以此协议发布（也可以用其他协议），<br/>但与此协议相关的代码必需遵循此协议。</td>
<td>1. <font color=#0000FF>公开源码</font><br/>2. <font color=#0000FF>库引用</font><br/>3. <font color=#0000FF>协议和版权信息</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>专利授权</font><br/>5. <font color=#00EE00>私用</font><br/>6. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/mozilla/">Mozilla</a></td>
<td>Mozilla Public License(MPL 2.0)是由Mozilla基金创建维护的，<br/>旨在较为宽松的BSD协议和更加互惠的GPL协议中找一个折衷点。</td>
<td>1. <font color=#0000FF>公开源码</font><br/>2. <font color=#0000FF>协议和版权信息</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>专利授权</font><br/>5. <font color=#00EE00>私用</font><br/>6. <font color=#00EE00>附加协议</font></td>
<td>1. <font color=#FF3030>责任承担</font><br/>2. <font color=#FF3030>商标使用</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/no-license/">No license</a></td>
<td>作者保留所有权利，不允许他人分发，复制或者创造衍生物。<br/>当你将代码发表在一些网站上时需要遵守该网站的协议，<br/>此协议可能包含了一些对你劳动成果的授权许可。<br/>比如将代码发布到GitHub，那么就必须同意别人查看和fork。</td>
<td>1. <font color=#0000FF>协议和版权信息</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>私用</font></td>
<td>1. <font color=#FF3030>分发</font><br/>2. <font color=#FF3030>修改</font><br/>3. <font color=#FF3030>附加协议</font></td>
</tr>
<tr>
<td><a target="_blank" rel="noopener" href="http://choosealicense.com/licenses/unlicense/">Public domain dedication</a></td>
<td>在许多国家，默认版权归作者自动拥有，<br/>所以<a target="_blank" rel="noopener" href="http://unlicense.org/">Unlicense</a>协议提供了一种通用的模板。<br/>此协议表明作者放弃版权，将劳动成果无私贡献出来，<br/>会丧失作品全部权利，包括在MIT/X11中定义的无担保权利。</td>
<td>1. <font color=#0000FF>N/A</font></td>
<td>1. <font color=#00EE00>商用</font><br/>2. <font color=#00EE00>分发</font><br/>3. <font color=#00EE00>修改</font><br/>4. <font color=#00EE00>私用</font></td>
<td>1. <font color=#FF3030>责任承担</font></td>
</tr>
</tbody></table>
<h2 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h2><ul>
<li><a target="_blank" rel="noopener" href="https://github.com/github/choosealicense.com">https://github.com/github/choosealicense.com</a></li>
<li><a target="_blank" rel="noopener" href="https://opensource.org/licenses">https://opensource.org/licenses</a></li>
<li><a target="_blank" rel="noopener" href="https://www.cnblogs.com/Wayou/p/how_to_choose_a_license.html">https://www.cnblogs.com/Wayou/p/how_to_choose_a_license.html</a></li>
<li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/87855729">https://zhuanlan.zhihu.com/p/87855729</a></li>
</ul>
<hr>
<p>欢迎关注我的微信公众号【数据库内核】：分享主流开源数据库和存储引擎相关技术。</p>
<img src="https://dbkernel-1306518848.cos.ap-beijing.myqcloud.com/wechat/my-wechat-official-account.png" width="400" height="400" alt="欢迎关注公众号数据库内核" align="center"/>

<table>
<thead>
<tr>
<th>标题</th>
<th>网址</th>
</tr>
</thead>
<tbody><tr>
<td>GitHub</td>
<td><a href="https://dbkernel.github.io/">https://dbkernel.github.io</a></td>
</tr>
<tr>
<td>知乎</td>
<td><a target="_blank" rel="noopener" href="https://www.zhihu.com/people/dbkernel/posts">https://www.zhihu.com/people/dbkernel/posts</a></td>
</tr>
<tr>
<td>思否（SegmentFault）</td>
<td><a target="_blank" rel="noopener" href="https://segmentfault.com/u/dbkernel">https://segmentfault.com/u/dbkernel</a></td>
</tr>
<tr>
<td>掘金</td>
<td><a target="_blank" rel="noopener" href="https://juejin.im/user/5e9d3ed251882538083fed1f/posts">https://juejin.im/user/5e9d3ed251882538083fed1f/posts</a></td>
</tr>
<tr>
<td>开源中国（oschina）</td>
<td><a target="_blank" rel="noopener" href="https://my.oschina.net/dbkernel">https://my.oschina.net/dbkernel</a></td>
</tr>
<tr>
<td>博客园（cnblogs）</td>
<td><a target="_blank" rel="noopener" href="https://www.cnblogs.com/dbkernel">https://www.cnblogs.com/dbkernel</a></td>
</tr>
</tbody></table>

      
    </div>
    <div class="article-footer">
      <blockquote class="mt-2x">
  <ul class="post-copyright list-unstyled">
    
    <li class="post-copyright-link hidden-xs">
      <strong>本文链接：</strong>
      <a href="http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/" title="技术分享 | 如何为你的代码选择一个合适的开源协议？" target="_blank" rel="external">http://dbkernel.github.io/2021/08/19/how-to-choose-open-source-licence/</a>
    </li>
    
    <li class="post-copyright-license">
      <strong>版权声明： </strong> 本博客所有文章除特别声明外，均采用 <a href="http://creativecommons.org/licenses/by/4.0/deed.zh" target="_blank" rel="external">CC BY 4.0 CN 许可协议</a>，转载请注明出处！
    </li>
  </ul>
</blockquote>


<div class="panel panel-default panel-badger">
  <div class="panel-body">
    <figure class="media">
      <div class="media-left">
        <a href="https://github.com/dbkernel" target="_blank" class="img-burn thumb-sm visible-lg">
          <img src="../../../../images/avatar.png" class="img-rounded w-full" alt="">
        </a>
      </div>
      <div class="media-body">
        <h3 class="media-heading"><a href="https://github.com/dbkernel" target="_blank"><span class="text-dark">DBKernel</span><small class="ml-1x">资深数据库开发工程师</small></a></h3>
        <div>目前从事云数据库MySQL/PostgreSQL的研发工作，曾做过PGXC、Greenplum等分布式数据库的内核开发。热衷于研究主流数据库架构、源码，对关系型数据库 MySQL/PostgreSQL及分布式数据库有深入研究。</div>
      </div>
    </figure>
  </div>
</div>


    </div>
  </article>
  
    
  <section id="comments">
  	
           
    
  </section>


  
</div>

  <nav class="bar bar-footer clearfix" data-stick-bottom>
  <div class="bar-inner">
  
  <ul class="pager pull-left">
    
    
    <li class="next">
      <a href="../../../01/26/clickhouse-and-friends-15-groupby/" title="源码分析 | ClickHouse和他的朋友们（15）Group By 为什么这么快"><span>下一篇&nbsp;&nbsp;</span><i class="icon icon-angle-right" aria-hidden="true"></i></a>
    </li>
    
    
    <li class="toggle-toc">
      <a class="toggle-btn collapsed" data-toggle="collapse" href="#collapseToc" aria-expanded="false" title="文章目录" role="button">
        <span>[&nbsp;</span><span>文章目录</span>
        <i class="text-collapsed icon icon-anchor"></i>
        <i class="text-in icon icon-close"></i>
        <span>]</span>
      </a>
    </li>
    
  </ul>
  
  
  <!-- Button trigger modal -->
  <button type="button" class="btn btn-fancy btn-donate pop-onhover bg-gradient-warning" data-toggle="modal" data-target="#donateModal"><span>赏</span></button>
  <!-- <div class="wave-icon wave-icon-danger btn-donate" data-toggle="modal" data-target="#donateModal">
    <div class="wave-circle"><span class="icon"><i class="icon icon-bill"></i></span></div>
  </div> -->
  
  
  <div class="bar-right">
    
    <div class="share-component" data-sites="weibo,qq,wechat,qzone,facebook,twitter,linkedin" data-mobile-sites="weibo,qq,wechat,qzone,linkedin"></div>
    
  </div>
  </div>
</nav>
  
<!-- Modal -->
<div class="modal modal-center modal-small modal-xs-full fade" id="donateModal" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document">
    <div class="modal-content donate">
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
      <div class="modal-body">
        <div class="donate-box">
          <div class="donate-head">
            <p>感谢您的支持，我会继续努力的!</p>
          </div>
          <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade active in" id="alipay">
              <div class="donate-payimg">
                <img src="../../../../images/donate/alipayimg.png" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开支付宝扫一扫，即可进行扫码打赏哦</p>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="wechatpay">
              <div class="donate-payimg">
                <img src="../../../../images/donate/wechatpayimg.png" alt="扫码支持" title="扫一扫" />
              </div>
              <p class="text-muted mv">扫码打赏，你说多少就多少</p>
              <p class="text-grey">打开微信扫一扫，即可进行扫码打赏哦</p>
            </div>
          </div>
          <div class="donate-footer">
            <ul class="nav nav-tabs nav-justified" role="tablist">
              <li role="presentation" class="active">
                <a href="#alipay" id="alipay-tab" role="tab" data-toggle="tab" aria-controls="alipay" aria-expanded="true"><i class="icon icon-alipay"></i> 支付宝</a>
              </li>
              <li role="presentation" class="">
                <a href="#wechatpay" role="tab" id="wechatpay-tab" data-toggle="tab" aria-controls="wechatpay" aria-expanded="false"><i class="icon icon-wepay"></i> 微信支付</a>
              </li>
            </ul>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>



</main>

  <footer class="footer" itemscope itemtype="http://schema.org/WPFooter">
	
	
    <ul class="social-links">
    	
        <li><a href="../../../../https:/github.com/dbkernel" target="_blank" title="Github" data-toggle=tooltip data-placement=top><i class="icon icon-github"></i></a></li>
        
        <li><a href="../../../../atom.xml" target="_blank" title="Rss" data-toggle=tooltip data-placement=top><i class="icon icon-rss"></i></a></li>
        
    </ul>

    <div class="copyright">
    	
        &copy; 2022 DBKernel
        
        <div class="publishby">
        	Theme by <a href="https://github.com/cofess" target="_blank"> cofess </a>base on <a href="https://github.com/cofess/hexo-theme-pure" target="_blank">pure</a>.
        </div>
    </div>
</footer>
  <script src="//cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')
</script>

<script src="../../../../js/plugin.min.js"></script>


<script src="../../../../js/application.js"></script>


    <script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/',
        CONTENT_URL: '../../../../content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="../../../../js/insight.js"></script>






   
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>





   
    
  <!-- <link rel="stylesheet" href="https://unpkg.com/gitalk/dist/gitalk.css"> -->
  <script src="//cdn.jsdelivr.net/npm/gitalk@1.4.0/dist/gitalk.min.js"></script>
  <script src="//cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js"></script>
  <script type="text/javascript">
  var gitalk = new Gitalk({
    clientID: '642675de9efee853bde8',
    clientSecret: 'e481d901d83ac31b4041437ec30a4fd00d112cfa',
    repo: 'dbkernel/gitalk-comment',
    owner: 'dbkernel',
    admin: ['dbkernel1989'],
    id: md5(location.pathname),
    distractionFreeMode: true
  })
  gitalk.render('comments')
  </script>

      






    <script defer>
var _hmt = _hmt || [];
(function() {
    var hm = document.createElement("script");
    hm.src = "//hm.baidu.com/hm.js?bf7f972e25b6a36ff4b828ba0214e515";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
})();
</script>



</body>
</html>